#coding=utf-8
import datetime
import threading
import time
import re
# import schedule
import os
import shutil

#
# tt = 1637658292.3688993
# cc = 1637658297.485184
# print((tt-cc) > 360)
# print(time.time())
# print(datetime.datetime.now())
# print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
#
# # 日期格式话模版
# format_pattern = "%Y-%m-%d %H:%M:%S"
#
# # 具体日期 年/月/日 时/分/秒
# start_date = "2021-12-09 13:20:38"
#
# end_date = datetime.datetime.now()
# print(end_date)  # datetime.datetime(2018, 10, 15, 11, 19, 52, 186250)
# print(type(end_date))  # <type 'datetime.datetime'>
#
# # 将 'datetime.datetime' 类型时间通过格式化模式转换为 'str' 时间
# end_date = end_date.strftime(format_pattern)
# print(end_date, type(end_date))  # ('2018-10-15 11:21:44', <type 'str'>)
#
# # 将 'str' 时间通过格式化模式转化为 'datetime.datetime' 时间戳, 然后在进行比较
# difference = (datetime.datetime.strptime(end_date, format_pattern) - datetime.datetime.strptime(start_date, format_pattern))
#
# # 可以获取天(days), 或者秒(seconds)
# print(difference)
#
# print(difference.seconds)
# print(difference.days)
#
#
# str = "   2e3e3e3e3dafdas   "
# print(str)
# str = str.strip()
# print(str)
# numReg = re.search(r'\d{2,4}', '  2e3e3e3e3dafdas  ')
# print(numReg)
#



# cd = "独女：离异，86年。学历：大专"
# "身高：158"
# "工作：宁波凯翔工程有限公司"
# "女孩名下有房，有车，"
# "年薪：10万"
# "短婚无孩，找个要求相当，年龄相差1一5年，在姜山一宁波周边人（李）"
# msg_text = cd.strip()
# locale_text = ""
# count = time.time() - time.time()
# numReg = re.search(r'\d{2,4}', msg_text)
# maleReg = re.search(r'(男|女)', msg_text)
# if str(numReg) != 'None' and str(maleReg) != 'None' and len(msg_text) > 50:
#     if msg_text not in locale_text:
#         print(1)
#     else:
#         print(2)
# else:
#     print(3)


#
# a = '中老年公益'
# print('中老年' not in a)

# str = '宁波本地男，8T年生，身高l7O米，大专，国企，年薪T一8万，有车有房无按揭，原生家庭，父毌均己退休，父争业，毌企业，希望找性格好的本地小娘，工作稳定。父亊业。'
# keyword_not_in_reg = re.search(r'配|对|也|有没有', str)
# print(keyword_not_in_reg)
# num_reg = re.search(r'\d{2,4}', str)
# print(num_reg)

# localtime = time.asctime( time.localtime(time.time()) )
# print("本地时间为 :", localtime)
#
# localtime = time.localtime(time.time())
# print("本地时间为 :", localtime)
#
# localtime = time.asctime( time.localtime(time.time()) )
# print("本地时间为 :", localtime)
#
# if 110101 > int(time.strftime("%H%M%S")) > 10510:
#     print(1)
# else:
#     print(2)

# str = '宁波本地男，8T年生，身高l7O米，大专，国企，年薪T一8万，有车有房无按揭139365563292，原生家庭，父毌均己退休，有车有房无按揭139365563292父争业，毌企业，希望找性格好的本地小娘，工作稳定。父亊业。'
# num_reg = re.search(r'(((13[0-9]{1})|(14[57]{1})|(15[012356789]{1})|(17[03678]{1})|(18[0-9]{1})|(19[89]{1})|(16[6]{1}))+\d{8})', str)
# print(num_reg)


# msg_text = 'MB75013性别：女婚姻情况：离异出生年份：1975身高：165体重：52公斤籍贯：浙江余姚人住址位置：余姚年薪：15W爱好：旅游学历：本科工作地区：余姚工作行业：小学教师房车情况：无房有车子女情况：女25岁个人性格：性格文静，温和，善良三观正！其他情况：有女25岁已工作，且住一起，婚后不打算在要孩子，不吸烟，不喝酒，不赌博！择偶要求：年龄相仿，68-78，三观合，人品端正，没有不良嗜好！希望男方最好距离近些，毕竟陪伴才是最长情的告白，也希望对方性格温和善解人意，能共同散步，能聊到夕阳红！'
# num_reg = re.search(r'\d{2,4}', msg_text)
# male_reg = re.search(r'(男|女)', msg_text)
# keyword_not_in_reg = re.search(r'有没有|引用|- - -|@', msg_text)
# phone_reg = re.search(r'(((13[0-9]{1})|(14[57]{1})|(15[012356789]{1})|(17[03678]{1})|(18[0-9]{1})|(19[89]{1})|(16[6]{1}))+\d{8})', msg_text)
# if str(num_reg) != 'None' and str(male_reg) != 'None' and str(keyword_not_in_reg) == 'None' and str(phone_reg) == 'None' and len(msg_text) > 60:
#     print(11)
# else:
#     print(22)
# print(len(msg_text))


# count =6
# print(count %3)



# #定义一个带参函数方法，里面设置时分秒，通过计算秒数来获取定时多久
# def sleeptime(hour, min, sec):
#     return hour * 3600 + min * 60 + sec
#
#
# # 这是隔5秒执行一次
# second = sleeptime(0, 0, 5)
# while 1 == 1:
#     time.sleep(second)
#     print('do action')



# def job():
#     print("Im working...")
#
# def run_threaded(job_func):
#     job_thread = threading.Thread(target=job_func)
#     job_thread.start()
# schedule.every(5).seconds.do(run_threaded, job)
#
# while True:
#     schedule.run_pending()
# print(111)



# print(time.time())
# # time.sleep(3)
# print(time.time())
#
# a = 1653614011.5368726 - 1653614008.535896
# print(a)
# a = [{'Uin': 0, 'UserName': '@@1', 'NickName': '福玲家里', 'HeadImgUrl': '/cgi-bin/mmwebwx-bin/webwxgetheadimg?seq=737203583&username=@@c1850dab4be0481a35bec45db4a23bd460ff848eee917849a67b7d3048a12487&skey=@crypt_fc48c4eb_746845c7b9565d398da21540b477b215', 'ContactFlag': 2051, 'MemberCount': 0, 'MemberList': [], 'RemarkName': '', 'HideInputBarFlag': 0, 'Sex': 0, 'Signature': '', 'VerifyFlag': 0, 'OwnerUin': 0, 'PYInitial': 'FLJL', 'PYQuanPin': 'fulingjiali', 'RemarkPYInitial': '', 'RemarkPYQuanPin': '', 'StarFriend': 0, 'AppAccountFlag': 0, 'Statues': 0, 'AttrStatus': 0, 'Province': '', 'City': '', 'Alias': '', 'SnsFlag': 0, 'UniFriend': 0, 'DisplayName': '', 'ChatRoomId': 0, 'KeyWord': '', 'EncryChatRoomId': '', 'IsOwner': 1, 'isAdmin': None, 'self': {'UserName': '@b615b341ce65482d1c00b74ad5449e49', 'City': '', 'DisplayName': '', 'PYQuanPin': '', 'RemarkPYInitial': '', 'Province': '', 'KeyWord': '', 'RemarkName': '', 'PYInitial': '', 'EncryChatRoomId': '', 'Alias': '', 'Signature': '我们的时间都很宝贵 即使那些无聊的时间也是有限的<span class="emoji emoji1f603"></span>做自己', 'NickName': 'Lin.', 'RemarkPYQuanPin': '', 'HeadImgUrl': '/cgi-bin/mmwebwx-bin/webwxgeticon?seq=1807532919&username=@b615b341ce65482d1c00b74ad5449e49&skey=@crypt_fc48c4eb_746845c7b9565d398da21540b477b215', 'UniFriend': 0, 'Sex': 1, 'AppAccountFlag': 0, 'VerifyFlag': 0, 'ChatRoomId': 0, 'HideInputBarFlag': 0, 'AttrStatus': 0, 'SnsFlag': 305, 'MemberCount': 0, 'OwnerUin': 0, 'ContactFlag': 0, 'Uin': 1231039861, 'StarFriend': 0, 'Statues': 0, 'MemberList': [], 'WebWxPluginSwitch': 0, 'HeadImgFlag': 1}},{'Uin': 0, 'UserName': '@@2', 'NickName': '福玲家里', 'HeadImgUrl': '/cgi-bin/mmwebwx-bin/webwxgetheadimg?seq=737203583&username=@@c1850dab4be0481a35bec45db4a23bd460ff848eee917849a67b7d3048a12487&skey=@crypt_fc48c4eb_746845c7b9565d398da21540b477b215', 'ContactFlag': 2051, 'MemberCount': 0, 'MemberList': [], 'RemarkName': '', 'HideInputBarFlag': 0, 'Sex': 0, 'Signature': '', 'VerifyFlag': 0, 'OwnerUin': 0, 'PYInitial': 'FLJL', 'PYQuanPin': 'fulingjiali', 'RemarkPYInitial': '', 'RemarkPYQuanPin': '', 'StarFriend': 0, 'AppAccountFlag': 0, 'Statues': 0, 'AttrStatus': 0, 'Province': '', 'City': '', 'Alias': '', 'SnsFlag': 0, 'UniFriend': 0, 'DisplayName': '', 'ChatRoomId': 0, 'KeyWord': '', 'EncryChatRoomId': '', 'IsOwner': 1, 'isAdmin': None, 'self': {'UserName': '@b615b341ce65482d1c00b74ad5449e49', 'City': '', 'DisplayName': '', 'PYQuanPin': '', 'RemarkPYInitial': '', 'Province': '', 'KeyWord': '', 'RemarkName': '', 'PYInitial': '', 'EncryChatRoomId': '', 'Alias': '', 'Signature': '我们的时间都很宝贵 即使那些无聊的时间也是有限的<span class="emoji emoji1f603"></span>做自己', 'NickName': 'Lin.', 'RemarkPYQuanPin': '', 'HeadImgUrl': '/cgi-bin/mmwebwx-bin/webwxgeticon?seq=1807532919&username=@b615b341ce65482d1c00b74ad5449e49&skey=@crypt_fc48c4eb_746845c7b9565d398da21540b477b215', 'UniFriend': 0, 'Sex': 1, 'AppAccountFlag': 0, 'VerifyFlag': 0, 'ChatRoomId': 0, 'HideInputBarFlag': 0, 'AttrStatus': 0, 'SnsFlag': 305, 'MemberCount': 0, 'OwnerUin': 0, 'ContactFlag': 0, 'Uin': 1231039861, 'StarFriend': 0, 'Statues': 0, 'MemberList': [], 'WebWxPluginSwitch': 0, 'HeadImgFlag': 1}},{'Uin': 0, 'UserName': '@@3', 'NickName': '福玲家里', 'HeadImgUrl': '/cgi-bin/mmwebwx-bin/webwxgetheadimg?seq=737203583&username=@@c1850dab4be0481a35bec45db4a23bd460ff848eee917849a67b7d3048a12487&skey=@crypt_fc48c4eb_746845c7b9565d398da21540b477b215', 'ContactFlag': 2051, 'MemberCount': 0, 'MemberList': [], 'RemarkName': '', 'HideInputBarFlag': 0, 'Sex': 0, 'Signature': '', 'VerifyFlag': 0, 'OwnerUin': 0, 'PYInitial': 'FLJL', 'PYQuanPin': 'fulingjiali', 'RemarkPYInitial': '', 'RemarkPYQuanPin': '', 'StarFriend': 0, 'AppAccountFlag': 0, 'Statues': 0, 'AttrStatus': 0, 'Province': '', 'City': '', 'Alias': '', 'SnsFlag': 0, 'UniFriend': 0, 'DisplayName': '', 'ChatRoomId': 0, 'KeyWord': '', 'EncryChatRoomId': '', 'IsOwner': 1, 'isAdmin': None, 'self': {'UserName': '@b615b341ce65482d1c00b74ad5449e49', 'City': '', 'DisplayName': '', 'PYQuanPin': '', 'RemarkPYInitial': '', 'Province': '', 'KeyWord': '', 'RemarkName': '', 'PYInitial': '', 'EncryChatRoomId': '', 'Alias': '', 'Signature': '我们的时间都很宝贵 即使那些无聊的时间也是有限的<span class="emoji emoji1f603"></span>做自己', 'NickName': 'Lin.', 'RemarkPYQuanPin': '', 'HeadImgUrl': '/cgi-bin/mmwebwx-bin/webwxgeticon?seq=1807532919&username=@b615b341ce65482d1c00b74ad5449e49&skey=@crypt_fc48c4eb_746845c7b9565d398da21540b477b215', 'UniFriend': 0, 'Sex': 1, 'AppAccountFlag': 0, 'VerifyFlag': 0, 'ChatRoomId': 0, 'HideInputBarFlag': 0, 'AttrStatus': 0, 'SnsFlag': 305, 'MemberCount': 0, 'OwnerUin': 0, 'ContactFlag': 0, 'Uin': 1231039861, 'StarFriend': 0, 'Statues': 0, 'MemberList': [], 'WebWxPluginSwitch': 0, 'HeadImgFlag': 1}}]


# k = '男北仑人 1987年出生 净身高177cm  体重70公斤  全日制大专毕业  贝发集团工作  年薪十万多  原生家庭 婚房卢湾家园  父母都有养老金  都在上班  希望有缘女孩'
# kk = len(k)
# print(kk)

# bianhao = re.search(r'^--\d{1,}$','--32222222222')
# print(bianhao)

# os.makedirs('./image/', exist_ok=True)
# def urllib_download():
#     IMAGE_URL = "https://fxappoj.gangcai.store:4334/api/file/20220614/FAAB6B61-DB7D-4305-8E00-199E658830EF.jpeg"
#     from urllib.request import urlretrieve
#     urlretrieve(IMAGE_URL, './image/1.png')
# # def setDir(filepath):
# #     # filepath = './image'
# #     if not os.path.exists(filepath):
# #         os.mkdir(filepath)
# #     else:
# #         shutil.rmtree(filepath)
# #         os.mkdir(filepath)
#
# # setDir('./image')
# os.remove('./image/1.png')
# # urllib_download()
# print('download img1')


# s = '20220326/DC5FD8B7-A062-4ECA-9AFD-0B559E221C6A.jpeg'
# a = s.split(',')
# for p in a:
#     print(p)


# msg_content = '222'
# msg_content_reg = re.search(r'^--\d{1,}$', msg_content)
# if (msg_content_reg != None):
#     print(222)
import urllib.request
from urllib.parse import quote
import string

# def setDir(filepath):
#     # filepath = './image'
#     if not os.path.exists(filepath):
#         os.mkdir(filepath)
#     else:
#         shutil.rmtree(filepath)
#         os.mkdir(filepath)

# setDir('./image')
# IMAGE_URL = "https://fxappoj.gangcai.store:4334/api/nt/appo/appointments/" + "20220217/微信图片_20220217112638.jpg"

# IMAGE_URL = quote(IMAGE_URL,safe = string.printable)
# c=1
# try:
#     urllib.request.urlretrieve(IMAGE_URL, './image/%s.png' % c)  # 保存图片到本地，也可以用imurl来命名
#     c += 1
#     urllib.request.urlretrieve(IMAGE_URL, './image/%s.png' % c)  # 保存图片到本地，也可以用imurl来命名
#     c += 1
#     urllib.request.urlretrieve(IMAGE_URL, './image/%s.png' % c)  # 保存图片到本地，也可以用imurl来命名
#     c += 1
# except Exception as e:
#     print(e)

# s = '20220326/DC5FD8B7-A062-4ECA-9AFD-0B559E221C6A.jpeg'
# path = "test_use.r_i2.nfo.jpeg"
# aa = path.split(".")
# aaa = len(aa)
# suffix = aa[aaa-1]
# print("suffix: {}".format(suffix))

# c = 1
# suffix = "daa"
# pic_name= './image/{0}.{1}'.format(c, suffix)
# print(pic_name)

# birth = '1987-11-13'
# print(birth[0:4])

# a = '东钱湖万金社区红娘推荐性    别：男出生年月：88年婚姻状况：未婚'
# b=a.replace("东钱湖万金社区", "")
# print(b)

# print(int(time.strftime("%H%M%S")))


# if len('123') > 3:
#     print(len('123'))

# actual_nick_name = '11益友111'
# actual_nick_name_req = re.search(r'丁文|浅水|张新梓|益友|侠义|盈婷老师|陈菊芬13566075791|天使之恋|春天细雨|吴启浙|Monica.|银凤|亚玲', actual_nick_name)
# print(str(actual_nick_name_req))

# msg_text = 'afaf东钱湖万金社区212312312'
# type = type(msg_text)
# print(str(type),22222222)
#
# if type(msg_text) == str:
#     print(111)
# else:
#     print(222)
#
# msg_text = msg_text.replace("东钱湖万金社区", "")
# print(msg_text)
# try:
#     a = 1 / 0
# except Exception as exceptionErr:
#     print(exceptionErr,1111111111111111111111111111111)
# msgCount=12
# print(msgCount % 40)





# import sys
# print(sys.version)

# a = time.time()
# print(a)
# time.sleep(2)
# b = time.time()
# print(b)
# 单位为秒
# print(b-a)


# aa = "Hello World  dddd  dd d大 跌"
# aa = aa.replaceAll(" ", "_")
# print(aa)
# import sys
# for i in range(9):
#     # print('\'脑洞大开研究所a'+str(i+1)+',\'')
#     sys.stdout.write('\'脑洞大开研究所h'+str(i+1)+'\',')

# msg_text= '''
# TS-000591
# 婚姻: 未婚浒山
# 性别: 女      独生
# 生日:1999
# 身高/体重: 165/125
# 学历/职业: 本科/教培 10万/年
# 房车: 2套/奔驰
# 籍贯: 浙江省宁波市鄞州区
# 居住: 浙江省宁波市鄞州区
# 爱好: 素描、油画，偶尔漫改。追剧、旅游、乐高达人
# 自身情况: 个性开朗活泼，热爱生活、向往自由，性格单纯，易相处, 工作世纪大道, 生活福明街道
# 父母情况: 原生家庭，关系和睦（父亲是厂长，母亲2023去世）
# 择偶要求: 93后，身高175以上，长相尚可,性格好，不要太瘦，本科，宁波有房（无贷款）
#     '''
# keyword_not_in_reg = re.search(r'有没有|引用|- - -|@|接龙|东钱湖万金社区|公益|义务|相亲|陆埠|新浦|临山|范市|掌起|白沙|横河|浒山|逍林|周巷|观海', msg_text)
# phone_reg = re.search(r'(((13[0-9]{1})|(14[57]{1})|(15[012356789]{1})|(17[03678]{1})|(18[0-9]{1})|(19[89]{1})|(16[6]{1}))+\d{8})', msg_text)
# print(str(keyword_not_in_reg))
# if str(keyword_not_in_reg) == 'None' and len(msg_text) > 40:
#     print(1)

import random
rand_num = random.uniform(1,2)
print(rand_num)
